import http from '@/utils/http';
import {baseUrl} from './commonApi'

const paths = {
    getContributes:`${baseUrl}/contribute`,
    getContributesDetail:`${baseUrl}/contribute/{id}`,
    contribute:`${baseUrl}/contribute/{id}/attend`,
};
/**
 * 活动列表
 * @param {*} data :
 * @param {*} callback 
 * @returns 
 */
export function getContributes(data,callback){
    return  http.get(paths.getContributes,{data,noLogin:true},callback);
}

/**
 * 活动详情
 * @param {*} data :
 * @param {*} callback 
 * @returns 
 */
 export function getContributesDetail(id,data,callback){
    var tPath = paths.getContributesDetail.replace('{id}', id);
    return http.get(tPath, { data,noLogin:true }, callback)
}
/**
 * 投稿
 * @param {*} data :
 * @param {*} callback 
 * @returns 
 */
 export function contribute(id,data,callback){
    var tPath = paths.contribute.replace('{id}', id);
    return http.post(tPath, { data,noLogin:true }, callback)
}




